<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上传图片</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/@shadcn/ui@latest/dist/style.css" rel="stylesheet">
</head>
<body class="bg-gray-100 min-h-screen p-8">
    <div class="max-w-2xl mx-auto">
        <div class="flex justify-between items-center mb-8">
            <h1 class="text-3xl font-bold text-gray-900">上传图片</h1>
            <a href="{{ url_for('manage_images') }}" class="text-blue-500 hover:text-blue-700">
                返回管理页面
            </a>
        </div>

        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4">
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}

        <div class="bg-white rounded-lg shadow-md p-6">
            <form action="{{ url_for('upload') }}" method="post" enctype="multipart/form-data" class="space-y-4">
                <div class="space-y-2">
                    <label class="block text-gray-700">选择图片文件：</label>
                    <input type="file" 
                           name="file" 
                           accept="image/*" 
                           class="w-full border rounded p-2">
                </div>
                <button type="submit" 
                        class="w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
                    上传图片
                </button>
            </form>
        </div>
    </div>
</body>
</html> 